package cn.kgc.springscloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author 课工场
 * @date 2023/10/10
 * @description
 */
@Configuration
public class BeanConfig {

    @Bean
    @LoadBalanced    //让托管的RestTemplate具有负载均衡的能力
    public RestTemplate restTemplate(){

        return new RestTemplate();
    }

}
